:: Set encodeing to UTF-8 for console
@CHCP 65001
:: esp32平台交叉编译 thmar 脚本

ECHO OFF 
SETLOCAL
where cmake
if errorlevel 1 (
	ECHO cmake NOT FOUND.
	exit /B -1
)
ECHO cmake found
where conan
if errorlevel 1 (
	ECHO conan NOT FOUND.
	exit /B -1
)
ECHO conan found
:: 检查conan 版本,要求conan 2
conan --version | findstr /C:"Conan version 2"
if errorlevel 1 (
	ECHO coan 2 required.
	exit /B -1
)
where python
if errorlevel 1 (
	ECHO python NOT FOUND.
	exit /B -1
)
ECHO python found
:: 检查Python 版本,要求Python 3
python --version | findstr /C:"Python 3"
if errorlevel 1 (
	ECHO python 3 required.
	exit /B -1
)
SET sh_folder=%~dp0
:: 删除最后的 '\'
SET sh_folder=%sh_folder:~0,-1%

conan create . -pr:h conan2\profiles\esp32_gcc -pr:b default ^
	--build thmar --build missing  ^
	--test-folder "" 

:: -pr:h esp32_gcc 指定目标平台的profile
:: -pr:b default  指定编译平台的profile
:: --build missing 编译缺少的依赖库
:: --build thmar 强制编译thmar
:: --test-folder "" 跳过测试

ENDLOCAL